﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using System.Linq.Expressions;

namespace MI.ORM.IDAL
{
    public interface IDatabase
    {
        IQueryable<T> All<T>() where T : class;
        ICriteria CreateCriteria<T>() where T : class;
        IQueryable<T> FilterBy<T>(Expression<Func<T, bool>> expression) where T: class;
        void Add<T>(T entity) where T : class;
        void Update<T>(T entity) where T : class;
        void Delete<T>(T entity) where T : class;
        void Commit();
    }
}
